home *** CD-ROM | disk | FTP | other *** search
/ HAKERIS 11 / HAKERIS 11.ISO / linux / system / LinuxConsole 0.4 / linuxconsole0.4install-en.iso / opt0.4.lcm / share / penggy / chat / csnet.scm < prev    next >
Encoding:
Text File  |  2004-02-26  |  2.9 KB  |  89 lines

  1. ;;
  2. ;; Copyright (C) 2002-2003  Jean-Charles Salzeber <jc@varspool.net>
  3. ;;
  4. ;; This file is part of penggy.
  5. ;;
  6. ;; This program is free software; you can redistribute it and/or
  7. ;; modify it under the terms of the GNU General Public License
  8. ;; as published by the Free Software Foundation; either version 2
  9. ;; of the License, or (at your option) any later version.
  10. ;; 
  11. ;; This program is distributed in the hope that it will be useful,
  12. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. ;; GNU General Public License for more details.
  15. ;; 
  16. ;; You should have received a copy of the GNU General Public License
  17. ;; along with this program; if not, write to the Free Software
  18. ;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  19. ;; 02111-1307, USA.
  20. ;;                
  21. ;; $Id: csnet.scm,v 1.2 2003/02/01 13:45:28 chupa Exp $
  22. ;;
  23.  
  24.  
  25. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  26. ;;                                                                  ;;
  27. ;; Scheme script for logon into CompuServe servers                  ;;
  28. ;;                                                                  ;;
  29. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  30.  
  31. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  32. ;; general end function
  33. (define (cs-connect) 
  34.   (chat-try 120
  35.       '("Connected"      (chat-success))
  36.       '("Open"           (chat-success))
  37.       '("Unavailable"    (chat-failure))
  38.       '("Connect Failed" (chat-failure))
  39.       '("Not Available"  (chat-failure))
  40.       '("Unreachable"    (chat-failure))
  41.       '("No Connection"  (chat-failure))
  42.       '("Bad Password"   (chat-failure))
  43.       '("Login Invalid"  (chat-failure))
  44.       '("NO CARRIER"     (chat-failure))
  45.       '(else             (chat-failure))))
  46.  
  47.  
  48.  
  49. (define (cs-login)
  50.   (chat-try 20
  51.       '("Username"   (cs-send-login))
  52.       '("login"      (cs-send-login))
  53.       '("NO CARRIER" (chat-failure))
  54.       '(else         (chat-failure))))
  55.  
  56. (define (cs-send-login)
  57.   (chat-send "csn\r")
  58.   (chat-try 20
  59.       '("Password"   (begin
  60.                  (chat-send "csnet\r")
  61.                  (cs-connect)))
  62.       '("NO CARRIER"     (chat-failure))
  63.       '(else             (chat-failure))))
  64.  
  65. (define (cs-login-nopw)
  66.   (chat-try 20
  67.       '("Username"   (cs-send-login-nopw))
  68.       '("login"      (cs-send-login))
  69.       '("NO CARRIER" (chat-failure))
  70.       '(else         (chat-failure))))
  71.  
  72. (define (cs-send-login-nopw)
  73.   (chat-send "csn\r")
  74.   (cs-connect))
  75.  
  76. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  77. ;; Main entry point, it try to determine server type
  78. (define (chat-connect) 
  79.   (chat-try 20 
  80.       '("ANSNet"     (cs-login))
  81.       '("UU.Net"     (cs-login))
  82.       '("Saturn.BBN" (cs-login))
  83.       '("Sprint-IP"  (cs-login))
  84.       '("UQKT1"      (cs-login-nopw))
  85.       '("UQKT2"      (cs-login))
  86.       '("Connected"  (chat-success))
  87.       '("NO CARRIER" (chat-failure))
  88.       '(else         (chat-failure))))
  89.